import { createStore } from "vuex";
import moduleA from './store_a'
import moduleB from './store_b'

const store = createStore({
    state: {
        count: 100,
    },
    mutations:{
        addCount(state,payload){
            state.count += payload
        }
    },
    actions:{
        addCount({commit},{n}){
            commit("addCount",n)
        }
    },
    modules: {
        a: moduleA,
        b: moduleB,
    },
});

export default store;
